<?php
/**
 * Amazon报告请求
 * (amazon-model)
 */
namespace App\Models\Amazon;

use Illuminate\Database\Eloquent\Model;
class ReportRequest extends Model
{
    protected $connection = 'mysql_amazon';

    protected $table = 'report_request';

    protected $guarded  = [];

    /*
     * status
     * 1：待请求，
     * 2：完成，
     * 3：_CANCELLED_ || _DONE_NO_DATA_，
     * 4：请求中，
     * 5：_DONE_ 无ReportId，
     * 6：下载报告失败
     * */
    public static function getRequestDate($typeId){
        return self::query()->where('type_id',$typeId)->max('end_at');
    }
}
